Analysis of Strava activities - Mapping activities (almost) like Strava

In this notebook Strava activities (runs, in particular) are mapped and visualized in order to find relevant patterns among them. The ultimate aim is to create, in a final instance, an appealing visualization that resembles the one provided by Strava itself.

Data loading

This part is common for all notebooks, for simplicity. It takes all the Strava activities collected and stores them in lists, dataframes, geodataframes and trajectories for every type of activity (runs, hikes, rides and all).

Activities visualization - first attempt

Plot all hike activities in a map. HVplot guarantees a pleasant visualization, but with hikes it's pointless to find clusters of activities. In any case, this is a good example of how trajectories can be mapped together and be easily identified when not overlapped.

On the other hand, with too many overlapping activities it's complicated to identify how many of them are in a given area (even colours could be misleading). We can isolate starting points and plot them to have a better idea.

With a scatter plot of the starting points we can have an idea of how they are distributed.

Clustering activities

As predictable, most activities have been started from Trento. It would be pointless to carry out more analysis at this level, but we can check the distribution over the city area.

It's possible to see a first pattern: most of the activities started in the south-west part of the city, near the Adige river. Is it possible to better understand this?

This visualization confirm the main area of starting places. Can we infer something more with a clustering? Maybe the area where I live?

Using a dbscan technique it's clear that there are three main areas of starting points: two belongs to the Lungadige, while the other is located in San Pio X neighbourhood. So, assuming that I'm not living on the river, I probably live in the third area found (which is a right guess).

Strava-like heatmap visualization

For a further visualization, let's check out an heatmap of all the activities loaded.

Thanks to Folium, there is a representation with a heatmap of all the activities. It's easy to notice a greater concentration of points in the areas highlighted before.